import request from "@/request/index.js";

export function getUserList(pageParam) {
    return request({
        url: '/user/users',
        method: 'GET',
        params: {
            ...pageParam
        }
    })
}

export function addUser(userInfo) {
    return request({
        url: '/user/add',
        method: 'POST',
        data: userInfo
    })
}

export function getUserInfo(id) {
    return request({
        url: `/user/${id}`,
        method: 'GET'
    })
}

export function delUser(id) {
    return request({
        url: `/user/${id}`,
        method: "DELETE"
    })
}

export function editUser(userInfo) {
    return request({
        url: '/user/update',
        method: "PUT",
        data: userInfo
    })
}